package com.gomoku.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.*;

/**
 * 配置访问路径和静态资源之间的关系
 */
@Configuration
@Slf4j
public class WebConfig extends WebMvcConfigurationSupport {
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry){
        log.info("静态资源配置...");
        registry.addResourceHandler("/api/game/**")
                .addResourceLocations("classpath:/front/html/");
        registry.addResourceHandler("/api/css/**")
                .addResourceLocations("classpath:/front/css/");
        registry.addResourceHandler("/api/js/**")
                .addResourceLocations("classpath:/front/js/");
        registry.addResourceHandler("/api/images/**")
                .addResourceLocations("classpath:/front/images/");
    }
} 